﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using Ample.BLL.Store;
/// <summary>
/// Summary description for Store
/// </summary>
/// 

namespace Ample.Web
{
    [System.ComponentModel.DataObject]
    public class CurrentUserShoppingCart
    {
        [System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Select, true)]
        public static ICollection<ShoppingCartItem> GetItems()
        {
            return (HttpContext.Current.Profile as ProfileCommon).ShoppingCart.Items;
        }

        //[System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Delete, false)]
        //public static void DeleteItem(int id)
        //{
        //    (HttpContext.Current.Profile as ProfileCommon).ShoppingCart.DeleteItem(id);
        //}

        [System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Delete, true)]
        public static void DeleteProduct(int line)
        {
            (HttpContext.Current.Profile as ProfileCommon).ShoppingCart.DeleteProduct(line);
        }

        public static void Clear()
        {
            (HttpContext.Current.Profile as ProfileCommon).ShoppingCart.Clear();
        }
    }
}